# -*- coding: utf-8 -*-
# @Time    : 2022/7/16 18:45
# @Author  : feng
# @Email   : feng@163.com
# @File    : bjlxr_page.py
# @Software: PyCharm
from selenium.webdriver.common.by import By
from pages.login_page import LoginPage
from pages.base_page import BasePage

class BjlxrPage(BasePage):
    '''进入编辑商机页面'''
    url='http://192.168.1.5:8081/crm/index.php?m=business&a=edit&id=4'
    '''定位器'''
    lxr_locator=(By.CSS_SELECTOR,'body > div.container > div.row > div > form > table > tbody > tr:nth-child(4) > td:nth-child(2)')

    qh_locator=(By.XPATH,'/html/body/div[10]')

    xz_locator=(By.NAME,'contacts')

    qiehuan_locator=(By.CSS_SELECTOR,'body > div:nth-child(17) > div.ui-dialog-buttonpane.ui-widget-content.ui-helper-clearfix')
    qr_locator=(By.XPATH,'/html/body/div[10]/div[3]/div/button[1]/span')

    bc_locator=(By.NAME,'submit')


    def click_lxr(self):
        self.driver.find_element(*self.lxr_locator).click()#切换到选择联系人框
    def click_xz(self):
        self.driver.find_element(*self.xz_locator).click()#选择
    def click_qr(self):
        self.driver.find_element(*self.qr_locator).click()#确认
    def click_bc(self):
        self.driver.find_element(*self.bc_locator).click()#保存